// pages/qiye_jieshao/qiye_jieshao.js
const app = getApp()
//获得全局js变量
var util = require('../../utils/util.js');
Page({
    data: {
        info: {},
        id: 0,
        userinfo: {}
    },
    onLoad(options) {
        this.setData({
            id: options.id,
            userinfo: wx.getStorageSync('user')
        });
        this.getinfo();
    },
    getinfo() {
        const that = this;
        util.httpRrquest(app.data.apiurl + 'shop/getMyshop', 'GET')
        .then(function (response) {
            that.setData({
                info: response.data.data.data
            });
        }, function (error) {
            console.log(error);
        });
        
    },
    toNum(event) {
        const index = event.currentTarget.dataset.index;
        const type = event.currentTarget.dataset.type;
        console.log(index);
        wx.navigateTo({
            url: '/pages/caiGouNum/caiGouNum?navType='+index+'&type='+type+'&id='+this.data.id
        });
    }
});